<?php 
	$s=$_GET["q"];
	require ("main_function.php"); 
	$query="select tsiswa.idSiswa,tsiswa.nmSis,tsiswa.asalSkol,ttran_karak.tipe1,ttran_karak.tipe2,ttran_karak.tipe3,ttran_karak.tipe4, ";
	$query=$query."tbakat.tipe1,tbakat.tipe2,tbakat.tipe3,tbakat.tipe4 ";
	$query=$query."from ttran_karak inner join (tsiswa inner join tbakat on tsiswa.idSiswa=tbakat.kdBakat) ";
	$query=$query."on ttran_karak.idSiswa=tsiswa.idSiswa where tsiswa.asalSkol like '%".$s."%'";
	$result=mysql_query($query) or die("error Querynya= ".mysql_error());
	echo "<table border='1' cellpadding='4' cellspacing='0' >
	<tr bgcolor=#000000 align='center'>
	<td rowspan=2>User ID</td>
	<td rowspan=2>Nama</td>
	<td rowspan=2>Sekolah</td>
	<td colspan=4>Score Potensi Karakter</td>
	<td colspan=4>Score Potensi Minat Bakat</td>
	</tr>
	<tr bgcolor=#000000 align='center'>
	<td>Sanguinis</td>
	<td>Koleris</td>
	<td>Melankolis</td>
	<td>Phlegmatis</td>
	<td>Convensional</td>
	<td>Directive</td>
	<td>Supportive</td>
	<td>Inspirer</td>
	</tr>";

	while($row = mysql_fetch_array($result))
	  {
	  if ($warna==1){
	  echo "<tr>";
	  echo "<td bgcolor=#888888>" . $row[0] . "</td>";
	  echo "<td bgcolor=#888888>" . $row[1] . "</td>";
	  echo "<td bgcolor=#888888>" . $row[2] . "</td>";
	  echo "<td bgcolor=#888888 align='center'>" . $row[3] . "</td>";
	  echo "<td bgcolor=#888888 align='center'>" . $row[4] . "</td>";
	  echo "<td bgcolor=#888888 align='center'>" . $row[5] . "</td>";
	  echo "<td bgcolor=#888888 align='center'>" . $row[6] . "</td>";	  
	  echo "<td bgcolor=#888888 align='center'>" . $row[7] . "</td>";	  
	  echo "<td bgcolor=#888888 align='center'>" . $row[8] . "</td>";	 
	  echo "<td bgcolor=#888888 align='center'>" . $row[9] . "</td>";	
	  echo "<td bgcolor=#888888 align='center'>" . $row[10] . "</td>";		  
	  echo "</tr>";
	  $warna = 0 ;
	  }else{
	  echo "<tr>";
	  echo "<td bgcolor=#AAAAAA >" . $row[0] . "</td>";
	  echo "<td bgcolor=#AAAAAA >" . $row[1] . "</td>";
	  echo "<td bgcolor=#AAAAAA >" . $row[2] . "</td>";
	  echo "<td bgcolor=#AAAAAA align='center'>" . $row[3] . "</td>";
	  echo "<td bgcolor=#AAAAAA align='center'>" . $row[4] . "</td>";
	  echo "<td bgcolor=#AAAAAA align='center'>" . $row[5] . "</td>";
	  echo "<td bgcolor=#AAAAAA align='center'>" . $row[6] . "</td>";	  
	  echo "<td bgcolor=#AAAAAA align='center'>" . $row[7] . "</td>";	  
	  echo "<td bgcolor=#AAAAAA align='center'>" . $row[8] . "</td>";	 
	  echo "<td bgcolor=#AAAAAA align='center'>" . $row[9] . "</td>";	
	  echo "<td bgcolor=#AAAAAA align='center'>" . $row[10] . "</td>";		  
	  echo "</tr>";
	  $warna = 1;
	  }
	  }
	echo "</table>";
	mysql_close($konk);
?>